package com.xbb.monitor.repository;

import com.xbb.monitor.entity.Cpu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CpuRepository extends JpaRepository<Cpu,Long>{
    @Query("select c from Cpu c where DATE_FORMAT(c.time,?1) = str_to_date(?2, ?1)")
    List<Cpu> findByTime(String timeFormat,String time);
}
